package com.baizhi.hospital.controller;

import com.baizhi.hospital.annotation.LogAnnotation;
import com.baizhi.hospital.entity.Patient;
import com.baizhi.hospital.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class PatientController {

	@Autowired
	private PatientService patientService;

	@RequestMapping("/selectPatient")
	@LogAnnotation(value = "查看所有的患者",type = 2)
	public Map selectPatient(int page,int limit,String name){
		return patientService.selectPatient(page, limit, name);
	}


	@RequestMapping("/insertPatient")
	@LogAnnotation(value = "登记患者信息",type = 2)
	public Map insertPatient(Patient patient){
		return patientService.insertPatient(patient);
	}




	@RequestMapping("/updatePatient")
	@LogAnnotation(value = "修改患者信息",type = 2)
	public Map updatePatient(Patient patient){
		return patientService.updatePatient(patient);
	}


	@RequestMapping("/deletePatient")
	@LogAnnotation(value = "删除患者",type = 2)
	public Map deletePatient(int[] array){
		return patientService.deletePatient(array);
	}
}
